{layout name="../common/master"/}
<div id="right">
  <h4>
      <div class="btn-group">
          <a href="{$_SERVER['HTTP_REFERER']}" class="btn btn-success">返回</a>  {if condition="!empty($data)"}<span>统计日期：{:date("Y-m-d H:i:s",$data['create_time'])}</span>{/if}
      </div>
  </h4>
    <form action="" method="get" role="form">
        <div class="form-group">
            <input type="text" style="width: 200px;float: left;margin-right: 20px" class="form-control" {if condition="isset($_GET['date'])"}value="{$_GET['date']}"{/if} name="date" onclick="WdatePicker({startDate:'%y-%M-01',dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true})" placeholder="请输入统计日期">
        </div>
        <button type="submit" class="btn btn-primary">查询</button>
    </form>
    <div>
        <button type="submit" id="extend" class="btn btn-success">导出到Excel</button>
    </div>
    {if condition="!empty($userData)"}
    <div class="panel panel-default col-lg-5">
        <div class="panel-heading">
            <h3 class="panel-title">总量数据统计</h3>
        </div>
        <div class="panel-body">
            <table class="table table-hover table-bordered">
                <tbody>
                <tr>
                    <th>注册用户总量</th>
                    <td>{$userData['totaluser_count']}</td>
                </tr>

                <tr>
                    <th>借款用户总量</th>
                    <td>{$loanData['loanSuccessUserCount']}</td>
                </tr>
                <tr>
                    <th>借款申请用户总量</th>
                    <td>{$loanData['loanSubmitUserCount']}</td>
                </tr>

                <tr>
                    <th>借款笔数</th>
                    <td>{$loanData['loan_sucess_user']}</td>
                </tr>
                <tr>
                    <th>借款申请笔数</th>
                    <td>{$loanData['loan_submit_user']}</td>
                </tr>
                <tr>
                    <th>续借用户总量</th>
                    <td>{$loanData['totalMoreUserCount']}</td>
                </tr>
                <tr>
                    <th>总借款金额</th>
                    <td>{$loanData['loansuccess_total_amount']}</td>
                </tr>

                <tr>
                    <th>还款笔数</th>
                    <td>{$repayData['repay_total_count']}</td>
                </tr>
                <tr>
                    <th>总还款金额</th>
                    <td>{$repayData['repay_total_money']}</td>
                </tr>

                <tr>
                    <th>APP下载总量</th>
                    <td>{$appflyerData['totalAppInstall']}</td>
                </tr>

                <tr>
                    <th>总逾期金额</th>
                    <td>{$data['dueMoneyCount']}</td>
                </tr>
                <tr>
                    <th>总坏账金额</th>
                    <td>{$data['badMoneyCount']}</td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
    <div class="panel panel-default col-lg-5 col-lg-offset-1">
        <div class="panel-heading">
            <h3 class="panel-title">增长数据统计</h3>
        </div>
        <div class="panel-body">
            <table class="table table-hover table-bordered">
                <tbody>
                <tr>
                    <th>新增注册用户</th>
                    <td>{$data['moreUser']}</td>
                </tr>
                <tr>
                    <th>新增借款用户</th>
                    <td>{$data['moreLoanSuccessUser']}</td>
                </tr>
                <tr>
                    <th>新增借款申请用户</th>
                    <td>{$data['more_loanSubmit']}</td>
                </tr>
                <tr>
                    <th>新增借款笔数</th>
                    <td>{$data['moreLoanSuccess']}</td>
                </tr>
                <tr>
                    <th>新增还款笔数</th>
                    <td>{$data['moreRepayCount']}</td>
                </tr>
                <tr>
                    <th>新增续借用户</th>
                    <td>{$data['moreLanMoreTwoCount']}</td>
                </tr>
                <tr>
                    <th>APP新增下载量</th>
                    <td>{$appflyerData['moreAppIndtall']}</td>
                </tr>
                <tr>
                    <th>新增借款金额</th>
                    <td>{$data['moreLoanSuccessMoney']}</td>
                </tr>
                <tr>
                    <th>新增还款金额</th>
                    <td>{$data['moreRepayMoney']}</td>
                </tr>
                <tr>
                    <th>新增逾期金额</th>
                    <td>{$data['dueMoneyTodayCount']}</td>
                </tr>
                <tr>
                    <th>新增坏账金额</th>
                    <td>{$data['badMoneyToday']}</td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
    {else/}
    <div style="color: red;">
        暂无数据
    </div>
    {/if}


</div>
<script>
    $("#extend").click(function(){
        var url="{:URL('home/Analyse/daily',$_GET)}";
        url=url+"&extend=1";
        location.href=url;
    })
</script>
<script type="text/javascript" src="__PUBLIC__/home/tuo/DatePicker/WdatePicker.js"></script>